package com.tarena.lbs.content.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tarena.lbs.content.pojo.po.ArticlePO;
import com.tarena.lbs.content.pojo.query.ArticleQuery;
import com.tarena.lbs.content.pojo.vo.ArticleVO;
import com.tarena.lbs.content.pojo.vo.BusinessVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ArticleMapper extends BaseMapper<ArticlePO> {

    List<ArticleVO> selectArticleList( ArticleQuery articleQuery);

    List<ArticleVO> selectArticleListByGeo(ArticleQuery articleQuery, List<Integer> articleIds);

    @Select("select count(*) from lbs_article where shop_id=#{shopId}")
    Integer findArticles(Integer shopId);

    @Select("select user_id as id,user_name as businessName " +
            "from lbs_article where activity_id=#{id}")
    BusinessVO findBusinessById(Integer id);
}
